<fieldset style="height:100%;">
    <legend>管理员列表</legend>
    <div id="layout-02" style="height:94%; overflow:hidden;" class="bjui-layout"><div class="bjui-pageHeader">
        <form id="pagerForm" data-toggle="ajaxsearch" action="layout/layout-02.html" method="post" class="nice-validator n-red" novalidate="novalidate">
            <input type="hidden" name="pageCurrent" value="1111">
            <input type="hidden" name="pageSize" value="2222">
            <input type="hidden" name="orderField" value="${model.orderField)">
            <div class="bjui-searchBar">
                <label>名称：</label><input type="text" value="" name="code" size="10" class="form-control" style="width: 100px;">&nbsp;
                <button type="submit" class="btn btn-default" data-icon="search"><i class="fa fa-search"></i> 查询</button>&nbsp;
                <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo"><i class="fa fa-undo"></i> 清空查询</a>
                <!--<a href="{:url('Admin/add')}" data-toggle="dialog" data-width="800" data-height="400" data-id="dialog-normal"><i></i>管理员添加</a>-->
                <span><a href="{:url('admin/add')}" data-id="dialog-normal" data-toggle="dialog" ><i class="Hui-iconfont">&#xe600;</i> 添加管理员</a> </span>
            </div>
        </form>
    </div>
        <table class="table table-border table-bordered table-bg">
            <thead>
            <tr>
                <th scope="col" colspan="12">员工列表</th>
            </tr>
            <tr class="text-c">
                <th width="25"><input type="checkbox" name="" value=""></th>
                <th width="40">ID</th>
                <th width="150">管理员账号</th>
                <th width="150">密码</th>
                <th width="">角色名称</th>
                <th width="100">是否已启用</th>
                <th width="150">邮箱</th>
                <th width="100">手机</th>
                <th width="130">加入时间</th>
                <th width="100">更新时间</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $data as $k=>$v}
            <tr class="text-c">
                <td><input type="checkbox" value="{$v.id}" name="che"></td>
                <td>{$v.id}</td>
                <td>{$v.admin_user}</td>
                <td>{$v.admin_pass}</td>
                <td>{$v.role_names}</td>
                <td class="td-status"><span class="label label-success radius">已启用</span></td>
                <td>{$v.admin_emile}</td>
                <td>{$v.admin_phone}</td>
                <td>{$v.create_time}</td>
                <td>{$v.update_tiime}</td>
                <td>
                    <a href="{:url('edit',['id'=>$v.id])}" class="btn btn-green" data-toggle="navtab" data-id="form" data-reload-warn="本页已有打开的内容，确定将刷新本页内容，是否继续？">编辑</a>
                    <a href="__URL__/del/id/{$v.id}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？">删</a>
                </td>
                <!--<td class="td-manage"><a style="text-decoration:none" onClick="admin_stop(this,'{$v.id}')" href="javascript:;" title="停用"><i class="Hui-iconfont">&#xe631;</i></a> <a title="编辑" href="javascript:;" onclick='admin_edit("管理员编辑","{:url('Admin/edit',['id'=>$v.id])}","1","800","500")' class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> <a title="删除" href="javascript:;" onclick="admin_del(this,'{$v.id}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>-->
            </tr>
            {/foreach}

            </tbody>
        </table>
        <script>
            function admin_stop(obj,id) {
                alert('确认要停用吗？',function(index){
                    $.ajax({
                        type:'post',
                        url:"{:url('stop')}",
                        data:{"id":id},
                        dataType:"json",
                        success:function (res) {
                            if(res.status == 1){
                                //第四步   改好onClick="admin_start(this,{ $v.id})"
                                $(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_start(this,'+id+')" href="javascript:;" title="启用" style="text-decoration:none"><i class="Hui-iconfont">&#xe615;</i></a>');
                                //更改状态的现实结果
                                $(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">已停用</span>');
                                $(obj).remove();
                                layer.msg(res.msg,{icon: 5,time:1000});
                            }else{
                                layer.msg(res.msg,{icon: 5,time:1000});
                            }
                        }
                    });

                });
                function admin_stop(obj,id){

                    alert('确认要停用吗？',function(index){
                        //此处请求后台程序，下方是成功后的前台处理……
                        <!--第二步-->    //第三步，取实现后台逻辑
                        //ajax实现
                        $.ajax({
                            type:'post',
                            url:"{:url('stop')}",
                            data:{"id":id},
                            dataType:"json",
                            success:function (res) {
                                if(res.status == 1){
                                    //第四步   改好onClick="admin_start(this,{ $v.id})"
                                    $(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_start(this,'+id+')" href="javascript:;" title="启用" style="text-decoration:none"><i class="Hui-iconfont">&#xe615;</i></a>');
                                    //更改状态的现实结果
                                    $(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">已停用</span>');
                                    $(obj).remove();
                                    layer.msg(res.msg,{icon: 5,time:1000});
                                }else{
                                    layer.msg(res.msg,{icon: 5,time:1000});
                                }
                            }
                        });
                        <!--第二步end-->
                    });
                }

            }
        </script>
        </div>

</fieldset>